﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<DTO.Models.MEDIA>>" %>
<% 
    if (Model != null)
    {
        string domaincms = ConfigurationManager.AppSettings["domaincms"];
        if (Model.Count() > 0)
        {
            var modelMain = Model.Take(1).ToArray()[0];
            var sourceOther = Model.Skip(1);                     
%>

    <div class="dung-section-content">
        <div class="dung-col2 dung-other1 dung-left dung-text-center">
            <a href='<%= Url.Content("~/Tuvan/Detail/" + modelMain.MediaID + "?typeMediaName=" + ViewData["TypeMediaName"]) + "&pageIndex=1" %>'>
                <img src='<%= Html.Encode(domaincms + "/MediaImage/" + modelMain.ID.ToString() + ".jpg") %>'
                    width="100%" height="100" alt="" /></a>
        </div>
        <div class="dung-col2 dung-other2 dung-right">
            <p>
                <b class="dung-larger"><a href='<%= Url.Content("~/Tuvan/Detail/" + modelMain.MediaID + "?typeMediaName=" + ViewData["TypeMediaName"]) + "&pageIndex=1" %>'>
                    <%= modelMain.Title %></a></b>
                <br />
                <span class="dung-small">Ngày tạo
                    <%= Html.Encode(string.Format("{0:dd/MM/yyyy H:mm:ss tt}", modelMain.DateCreate)) %></span>
                <br />
                <span class="dung-small">Ngày cập nhật
                    <%= Html.Encode(string.Format("{0:dd/MM/yyyy H:mm:ss tt}", modelMain.DateModify)) %></span>
            </p>
            <p>
                <%= modelMain.Intro %>
            </p>
             <p class="dung-text-right">
                    <a href='<%= Url.Content("~/Tuvan/Detail/" + modelMain.MediaID + "?typeMediaName=" + ViewData["TypeMediaName"]) + "&pageIndex=1" %>'>
                        Chi tiết >></a></p>
        </div>
        <div class="clearer">
            &nbsp;</div>
        <div>
            <ul>
                <% foreach (var item in sourceOther)
                   { %>
                <li><a href='<%= Url.Content("~/Tuvan/Detail/" + item.MediaID + "?typeMediaName=" + ViewData["TypeMediaName"]) + "&pageIndex=1" %>'>
                    <%= item.Title %></a></li>
                <% } %>
            </ul>
        </div>
    </div>

<%
    }
}
%>
